% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/misc.R
\name{ordinalize}
\alias{ordinalize}
\alias{ord_3C}
\alias{ord_4C}
\alias{ord_5C}
\title{Ordinalize numeric vector}
\usage{
ordinalize(v, categories, max = 1, min = 0, vec = seq(min, max, by =
  max/categories))

ord_3C(...)

ord_4C(...)

ord_5C(...)
}
\arguments{
\item{v}{NumericVector}

\item{categories}{Desired number of ordinal categories}

\item{max}{Maximum of \code{v} scale}

\item{min}{Minimum of \code{v} scale}

\item{vec}{Bins passed to \code{\link{findInterval}}}

\item{...}{Additional arguments passed to \code{ordinalize}}
}
\description{
Ordinalize an interval scaled numeric vector based on
automatic equal-spaced intervals.
}
\details{
\code{ordinalize} should not be confused with the
    \code{\link{ord}} function. The latter ordinalizes the MM
    output using an ordinal scale transformation to map back to the
    original ordinal answer categories. The former simply splits up
    a numeric vector into equal intervals and assigns the given
    number of categories.

    Note, ordinalization is is done using left-open intervals. For
    example, the lowest category from the default \code{ord_5C}
    output is 0 corresponding to \code{N <= .2}, the second is 1
    for values \code{.2 < N <= .5}, and etc etc.
}
\section{Functions}{
\itemize{
\item \code{ord_3C}: Ordinalize to 3 categories according to
V-Dem rules. See the section, Details.

\item \code{ord_4C}: Ordinalize to 4 categories

\item \code{ord_5C}: Ordinalize to 5 categories
}}

\section{\code{ord_3C}}{

    The \code{ord_3C} by default operates slightly different from the
    other convenience functions. Rather than being a balanced
    ordinalization (\emph{i.e.,} equally spaced bins determining
    membership in each category), \code{ord_3C} passes in a \code{vec}
    of \code{c(0, .25, .5, 1)}. The rationale is that 3 category
    versions of indices are meant to represent "Autocratic" (0 -
    .25), "Electoral Authoritarian" (.25 - .5), and "Minimally
    Democratic" (.5 - 1).
}

\examples{
(v <- runif(5))

ordinalize(v, categories = 5)
ord_5C(v)

ord_4C(v)
ordinalize(v, categories = 4)

# Note the difference b/w output
ordinalize(v, categories = 3)
ord_3C(v)

}
